package com.ldk.framework.dao.impl;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.apache.ibatis.session.SqlSession;
import org.springframework.stereotype.Repository;

import com.ldk.base.framework.dao.impl.BaseDAO;
import com.ldk.framework.dao.IRegionDAO;
import com.ldk.framework.entity.Region;

/**
* RegionDAO接口实现类
* @author xiangwl
*/
@Repository
public class RegionDAO extends BaseDAO<Region> implements IRegionDAO {

	@Override
	public List<Region> getChildRegionList(String dbKey, int parentId) {
		try{
			Map<String, Object> parms = new HashMap<String, Object>();
			parms.put("parentId", parentId);
			SqlSession sqlSession = getSqlSession(dbKey);
			return sqlSession.selectList(getSqlName("selectList"), parms);
		}
		catch(Exception e){
			logger.error(e.getMessage());
		}
		return null;
	}
}
